import { stringify } from 'qs';
import request from '@/utils/request';

// 获取全部分页
export async function GetGroupListWithPage(params) {
    return request(`/${window.storeId}/Product/GetGroupListWithPage?${stringify(params)}`);
}

// 获取一级
export async function GetFirstGroupById(params) {
    return request(`/${window.storeId}/Product/GetFirstGroupById?${stringify(params)}`);
}

// 二级排序
export async function ChangeSecondGroupSort(params) {
    return request(`/${window.storeId}/Product/ChangeSecondGroupSort`, {
        method: 'POST',
        body: {
            ...params
        },
    });
}

// 一级排序
export async function ChangeFirstGroupSort(params) {
    return request(`/${window.storeId}/Product/ChangeFirstGroupSort`, {
        method: 'POST',
        body: {
            ...params
        },
    });
}




// 新增一级
export async function CreateFirstGroup(params) {
    return request(`/${window.storeId}/Product/CreateFirstGroup`, {
      method: 'POST',
      body: {
        ...params
      },
    });
  }

  // 修改一级
  export async function UpdateFirstGroup(params) {
    return request(`/${window.storeId}/Product/UpdateFirstGroup`, {
      method: 'POST',
      body: {
        ...params
      },
    });
  }

  // 删除一级
  export async function DelFirstGroup(params) {
    return request(`/${window.storeId}/Product/DelFirstGroup`, {
      method: 'POST',
      body: {
        ...params
      },
    });
  }



  // 新增二级
  export async function CreateSecondGroup(params) {
    return request(`/${window.storeId}/Product/CreateSecondGroup`, {
      method: 'POST',
      body: {
        ...params
      },
    });
  }

    // 修改二级
    export async function UpdateSecondGroup(params) {
        return request(`/${window.storeId}/Product/UpdateSecondGroup`, {
          method: 'POST',
          body: {
            ...params
          },
        });
      }

    // 删除二级
    export async function DelSecondGroup(params) {
        return request(`/${window.storeId}/Product/DelSecondGroup`, {
          method: 'POST',
          body: {
            ...params
          },
        });
  }